class ContImagem < ActiveRecord::Base
  has_one :conteudo, :as=>:extra

  has_attachment :content_type => :image, 
                 :storage => :file_system, 
                 :max_size => 500.kilobytes,
                 :resize_to => '320x400>',
                 :thumbnails => { :lista => '70x70>', :editor => '150x150>'}

  validates_as_attachment

  def full_filename(thumbnail = nil)
    #file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix].to_s
    file_system_path = "uploads/imagens"
    File.join(RAILS_ROOT, file_system_path , *partitioned_path(thumbnail_name_for(thumbnail)))
  end

  #def partitioned_path(*args)
  #  ["%04d" % attachment_path_id] + args
  #end 

end